
/**
 * 手机国家码列表
 */

export const state = () => {
  return {
    list: []
  }
}

export const mutations = {
  SET_LIST (state, list) {
    state.list = list || []
  }
}

export const getters = {
  area_code_list (state) {
    return state.list
  }
}

export const actions = {
  async GET_AREA_CODE ({ commit }){
    try {
      const { protocol,host} = location;
      let { data } = await this.$axios.get(`${protocol}//${host}/static/area_code.json`);
      commit('SET_LIST',data.data.countrys);
    } catch (e) {
      throw e;
    }
  }
}
